import { getAppList } from "@/api/app";

// 3.添加vuex参数
const state = {
  appList: "",
};

const mutations = {
  set_appList(state, data) {
    state.appList = data.data.appList;
  },
};

const actions = {
  getAppList({ commit }, query) {
    return new Promise((resolve, reject) => {
      getAppList(query).then((res) => {
        commit("set_appList", res);
      });
    });
  },
};

export default {
  namespaced: true,
  state,
  mutations,
  actions,
};
